<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>callback</title>
</head>
<body>
  

  <script type="text/javascript" src="./Callback.js"></script>
  <script type="text/javascript">
    
   function f1 () {
      alert('f1')
    }

    function f2 () {
      alert('f2')
    }
    function sum (a) {
      alert(this.b + a)
    }
    /* 
      var cb = Callback('one unique')

      cb.add(f1)
      cb.add(f2)
      cb.add(f1)
      cb.fire() 
      cb.fire()
    */

    var b = 10;

    var cb = Callback('memory one')

    cb.fire(window, [1])

    cb.add(sum)



  </script>
</body>
</html>